package com.luoying.itew.adapter;

import com.github.mikephil.charting.components.AxisBase;
import com.github.mikephil.charting.formatter.IAxisValueFormatter;

import java.util.List;

/**
 * Created by Administrator on 2018/5/29.
 * time 2018-5-10
 * author zm
 */
public class MyXFormatter  implements IAxisValueFormatter {

    private List<String> list;

    public MyXFormatter(List<String> values) {
        this.list = values;
    }

    private static final String TAG = "MyXFormatter";

    @Override
    public String getFormattedValue(float value, AxisBase axis) {
        // "value" represents the position of the label on the axis (x or y)
        if (value<list.size()){
            return list.get((int) (value));
        }else {
            return null;
        }
    }
}